package com.yiren.manager.service.impl.pension;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yiren.core.exception.MyException;
import com.yiren.core.service.GenericServiceImpl;
import com.yiren.core.utils.Favorites;
import com.yiren.entity.YrIndiServiceCost;
import com.yiren.entity.YrIndiServiceCostHistory;
import com.yiren.manager.repository.pension.YrIndiServiceCostHistoryRepository;
import com.yiren.manager.repository.pension.YrIndiServiceCostRepository;
import com.yiren.manager.service.iface.pension.YrIndiServiceCostService;

@Service("yrIndiServiceCostService")
public class YrIndiServiceCostServiceImpl extends GenericServiceImpl<YrIndiServiceCost, String> implements YrIndiServiceCostService{
	
	@Autowired
	YrIndiServiceCostHistoryRepository yrIndiServiceCostHistoryRepository;
	
	@Autowired
	public YrIndiServiceCostServiceImpl(YrIndiServiceCostRepository repository) {
		super(repository);
	}

	public void addByFavorites(Favorites entitys) throws MyException {
		YrIndiServiceCost entity = entitys.getFavorite(YrIndiServiceCost.class);
		YrIndiServiceCostHistory history = entitys.getFavorite(YrIndiServiceCostHistory.class);
	
		this.repository.save(entity);
		yrIndiServiceCostHistoryRepository.save(history);
	}

	public void modifyByFavorites(Favorites entitys) throws MyException {
		// TODO Auto-generated method stub
		
	}

}
